#pragma once

#include <ctime>
#include <memory>

class MyTime
{
public:
	static bool is_time_format(const char* string);
	static bool is_day_time(const char* string);
public:
	MyTime();
	MyTime(int h, int m, int s);
	MyTime(const char* string);

	int hour();
	int min();
	int sec();

	bool operator==(time_t time);

	void operator+=(const MyTime& rhs);
	MyTime operator+(const MyTime& rhs);
	MyTime operator-(const MyTime& rhs);
	
	bool operator>(const MyTime& rhs);
	bool operator<(const MyTime& rhs);

	bool between(MyTime& start, const MyTime& elapsed);

	void print_status();
	// remember to delete it.
	char* gen_str();

	std::unique_ptr<char[]> gen_str_cpp11();
private:
	MyTime(int seconds);
	int seconds = 0;
};

static const MyTime TEN_MINUTES(0, 10, 0);